﻿using System;

namespace Job.Core.Module
{
    /// <summary>
    /// 代表一个错误的业务规则。
    /// </summary>
    [Serializable]
    public class RuleViolation
    {
        /// <summary>
        /// 属性名称。
        /// </summary>
        public string PropertyName { get; private set; }

        /// <summary>
        /// 错误信息。
        /// </summary>
        public string ErrorMessage { get; private set; }

        /// <summary>
        /// 初始化 RuleViolation 类的新实例。
        /// </summary>
        /// <param name="propertyName">属性名称。</param>
        /// <param name="errorMessage">错误信息。</param>
        public RuleViolation(string propertyName, string errorMessage)
        {
            PropertyName = propertyName;
            ErrorMessage = errorMessage;
        }
    }
}
